-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
query engine integration #2074
base: master
Are you sure you want to change the base?
query engine integration #2074
Conversation
3acec8b
to
3e4ae13
Compare
3e4ae13
to
eaa2861
Compare
pub type Index<K> = multimap::MultiMap<K, RowPointer>; | ||
pub type IndexIter<'a, K> = multimap::MultiMapRangeIter<'a, K, RowPointer>; | ||
pub type UniqueIndex<K> = uniquemap::UniqueMap<K, RowPointer>; | ||
pub type UniqueIndexIter<'a, K> = uniquemap::UniqueMapRangeIter<'a, K, RowPointer>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah not needed. At least for right now.
8a4e30b
to
bace373
Compare
impl<T: StateView> SchemaView for SchemaViewer<'_, T> { | ||
fn table_id(&self, name: &str) -> Option<TableId> { | ||
let AuthCtx { owner, caller } = self.auth; | ||
self.tx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.tx | |
// Get the schema from the in-memory state instead of fetching from the database for speed |
@@ -836,16 +837,24 @@ impl ModuleHost { | |||
} | |||
|
|||
#[tracing::instrument(skip_all)] | |||
pub fn one_off_query(&self, caller_identity: Identity, query: String) -> Result<Vec<MemTable>, anyhow::Error> { | |||
pub fn one_off_query<F: WebsocketFormat>( | |||
&self, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now dead code? Why still here?
@@ -618,7 +743,7 @@ pub struct IxJoin { | |||
/// The expression for computing probe values. | |||
/// Values are projected from the lhs, | |||
/// and used to probe the index on the rhs. | |||
pub lhs_probe_expr: ProjectField, | |||
pub lhs_field: TupleField, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the rhs_label
turn into TupleField
instead?
@@ -575,25 +711,14 @@ pub enum Sarg { | |||
Range(ColId, Bound<AlgebraicValue>, Bound<AlgebraicValue>), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In
pub enum Sarg {
Range(ColId, Bound<AlgebraicValue>, Bound<AlgebraicValue>),
Range(ColId, Bound<AlgebraicValue>, Bound<AlgebraicValue>), | |
Range(BinOp,ColId, Bound<AlgebraicValue>, Bound<AlgebraicValue>), |
(for the plan printer)
Description of Changes
This patch integrates the new query engine into the query code path. It does not integrate the new engine into incremental evaluation path.
query
crate which is the top level crate for invoking the query engine.Multi-column index scans have not been added to the optimizer yet, but they will be once we remove the old engine. We have a benchmark that will fail if the old engine is removed without adding multi-column index scans.
The old engine will be removed once incremental evaluation has been updated to use the new engine.
API and ABI breaking changes
n/a
Expected complexity level and risk
4
The query engine is responsible for implementing the subscription logic, which is the only way to read data out of SpacetimeDB. As such, its correctness and performance is paramount.
Testing
We have already added tests to ensure we preserve semantics, with more being worked on currently. This patch updates the applicable benchmarks to ensure we maintain performance characteristics.